


clear all
set more off
capture log close


**************************set filepath here*************************************

global filepath "" // Adjust to your folder structure

*********************set subdirectories automatically **************************

global data  	"$filepath/data/"
global raw  	"$data/raw/"
global clean  	"$data/clean/"
global temp 	"$data/temp/" // This is where temporary data files are stored
global dofiles  "$filepath/do-files"
global ado 		"$filepath/do-files/ado"
global output  	"$filepath/output"
global tables  	"$output/tables"
global figures  "$output/figures"

*********************** Start log file *****************************************

log using "$filepath/master_logfile", replace

*********************set path to ado-file folder here***************************
adopath ++ "$ado/"

********************************************************************************
**********************generate the final datasets*******************************
********************************************************************************


/*Note that we cannot include the raw data for confidientiality reasons. 
The following do-file is creates the main dataset based on raw inputs */
// do "$dofiles/cleaning/cleaning_master.do"



********************************************************************************
********************************************************************************
**********************Generate outputs *****************************************
********************************************************************************
********************************************************************************

*** Set globals ***

*Set control variables
global contr female age member years_member experience canv_workshop canvass_any_before_main_unres app_before_main




********************************************************************************
**********************Tables and Raw output for Figures ************************
********************************************************************************

*** Main tables ***

do "$dofiles/tables/Table_1.do"
do "$dofiles/tables/Table_2.do"


*** Appendix Tables *** 
do "$dofiles/tables/Table_A1.do" 
do "$dofiles/tables/Table_A2.do"
do "$dofiles/tables/Table_A3.do"
do "$dofiles/tables/Table_A4.do"
do "$dofiles/tables/Table_A5.do"
do "$dofiles/tables/Table_A6.do"
do "$dofiles/tables/Table_A7.do" 
do "$dofiles/tables/Table_A8.do"
do "$dofiles/tables/Table_A9.do"
do "$dofiles/tables/Table_A10.do"
do "$dofiles/tables/Table_A11.do" 
do "$dofiles/tables/Table_A12.do" 
do "$dofiles/tables/Table_A13.do"
do "$dofiles/tables/Table_A14.do"
do "$dofiles/tables/Table_A15.do"
do "$dofiles/tables/Table_A16.do"
do "$dofiles/tables/Table_A17.do"
do "$dofiles/tables/Table_A18.do"
do "$dofiles/tables/Table_A19.do"
do "$dofiles/tables/Table_A20.do"
do "$dofiles/tables/Table_A21.do"


*** Main Figures ***
cap set scheme  lean2 // Set scheme for figures just for optics

* Figures A1 and A2 are not data based.
do "$dofiles/figures/Figure_1.do"
do "$dofiles/figures/Figure_A3.do"
do "$dofiles/figures/Figure_A4.do"
do "$dofiles/figures/Figure_A5.do"

********************************************************************************
********************************************************************************
********************************************************************************
log close
